/*    */ package com.zimbra.cs.dav;
/*    */ 
/*    */ import java.io.ByteArrayOutputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.OutputStream;
/*    */ import org.dom4j.Document;
/*    */ import org.dom4j.io.OutputFormat;
/*    */ import org.dom4j.io.XMLWriter;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class DomUtil
/*    */ {
/*    */   public static byte[] getBytes(Document doc)
/*    */     throws IOException
/*    */   {
/* 29 */     ByteArrayOutputStream baos = new ByteArrayOutputStream();
/* 30 */     writeDocumentToStream(doc, baos);
/* 31 */     byte[] msg = baos.toByteArray();
/* 32 */     return msg;
/*    */   }
/*    */   
/* 35 */   public static void writeDocumentToStream(Document doc, OutputStream out) throws IOException { OutputFormat format = OutputFormat.createPrettyPrint();
/* 36 */     format.setTrimText(false);
/* 37 */     format.setOmitEncoding(false);
/* 38 */     XMLWriter writer = new XMLWriter(out, format);
/* 39 */     writer.write(doc);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/dav/DomUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */